package com.errands.cn.mapper;

import com.errands.cn.entity.Recomment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import javax.validation.constraints.Size;
import java.util.List;

@Component
public interface RecommentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Recomment record);

    int insertSelective(Recomment record);

    Recomment selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Recomment record);

    int updateByPrimaryKey(Recomment record);

    List<Recomment> selectByOId(@Param("oId") Integer oId);

    @Select("select count(*) from recomment where uid= #{uid} and o_id = #{oid}")
    int orderRecommentByUserCount(@Param("uid") Integer uid,@Param("oid") Integer oid);
}